package com.health.ts.service;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.ts.constant.FrontPage;

/**
 * 基础业务服务
 */
public abstract class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> {
	
	/**
	 * 取得FrontPage中参数
	 * 
	 * @param page
	 * @param paramName
	 * @return
	 */
	protected String getParam(FrontPage frontPage, String paramName) {
		String paramValue = "";
		Map<String, Object> params = frontPage.getParams();
		if (params != null && params.get(paramName)!=null) {
			paramValue = params.get(paramName).toString();
		}
		return StringUtils.isNotEmpty(paramValue) ? paramValue : "";
	}
}
